package com.scriverecanzoni.server.persistence;

import com.googlecode.objectify.ObjectifyService;
import com.googlecode.objectify.helper.DAOBase;
import com.scriverecanzoni.client.entities.Word;

public class WordDAO extends DAOBase
{
    static {
        ObjectifyService.register(Word.class);
    }

    /** Your DAO can have your own useful methods */
    public Word getOrCreateWord(long id)
    {
        Word found = ofy().find(Word.class, id);
        if (found == null)
            return new Word(id);
        else
            return found;
    }
}